import DefaultTheme from "vitepress/theme";
import Layout from "./layout/index.vue";
import "./styles/index.css";
import { useData } from "vitepress";
import { watch, ref } from "vue";
import demo from "./demo/index.vue";
import "@yll10243/vue-form-render/dist/style.css";
import formRender from "@yll10243/vue-form-render/src/indev.vue";
export default {
  ...DefaultTheme,
  Layout,
  enhanceApp({ app, router, siteData }) {
    app.component("formRender", formRender);
    app.component("Demo", demo);
  },
  setup() {
    const { page } = useData();
    watch(
      () => page.value.relativePath,
      (now, pre) => {},
      {
        deep: true, //对层次复制的对象
        immediate: false, //是否立即执行
      }
    );
  },
};
